function Ankhy_Mage_1()
	------------------
	-- Cast Power Word: Fortitude
	if (vLastHoG == nil or (GetTime() - vLastHoG > 10)) then
	ccrCastBuffIfMissing("Mage Armor")
	vLastHoG = GetTime()
	return
	end
	 ---------------------
	 -- Cast Inner Fire
	ccrCastBuffIfMissing("Arcane Brilliance")
	 ---------------------
	-- Autoaccept LFR invite
	AcceptProposal();
	--------------------------
			--if (vLastHoG == nil or (GetTime() - vLastHoG > 10)) then
		--	SendChatMessage("ilvl 547 dps LFG FLEX 4", "CHANNEL", "Common",  "2");
			--vLastHoG = GetTime()
			--return
		--	end
			
			-- Interrupt
			if ccrSpellCanAttack("Counterspell")
			and ccrTargetIsCastingOrChanneling()
			and ccrTargetIsInteruptable()
			then
				if ccrTargetIsCasting()
				and ccrTargetHasLeftOnCast(1)
				then
					ccrCastAttack("Counterspell")
					return
				end
			end	
			
			-- Create Mana Gem
			
			if GetItemCount("Brilliant Mana Gem") == 0 and not ccrPlayerIsInCombat()
				then
				ccrCast("Conjure Mana Gem")
				return
			end
			
			-- Use mana gem
			
			if GetItemCount("Brilliant Mana Gem") > 0 
			and IsUsableItem("Brilliant Mana Gem") == 1
			and ccrPlayerMana() <= 85
			then
				UseItemByName("Brilliant Mana Gem")
			end
				
			-- Rune of Power with ShiftIsDown
			
			if IsShiftKeyDown() then 
				ccrCast("Rune of Power")
				CameraOrSelectOrMoveStart()
				CameraOrSelectOrMoveStop()
			return
			end
			
			
			--Thok Stopcasting
			
			if ccrTargetName("Thok the Bloodthirsty")
				and ccrTargetIsCastingSpell("Deafening Screech")
				then
				SpellStopCasting()
				return
			end
	
	-- Rotation
		if ccrPlayerIsInCombat() then
		-- CD
			if ccrTargetIsBoss()
				and SpellIsReady("Mirror Image")
					then
					ccrCast("Mirror Image")
					return
			end
			if ccrTargetIsBoss()
				and SpellIsReady("Arcane Power")
				and ccrPlayerHasDebuff("Arcane Charge")
				and ccrPlayerHasDebuffStacks("Arcane Charge", 4)
					then
					ccrCast("Arcane Power")
					return
			end
			-- Alter Time

			if ccrTargetIsBoss()
				and ccrPlayerHasBuff("Arcane Power") and SpellIsReady("Alter Time")
				and ccrPlayerHasDebuff("Arcane Charge") and ccrPlayerHasDebuffStacks("Arcane Charge", 4)
				and ccrPlayerHasBuff("Arcane Missiles!") and ccrPlayerHasBuffStacks("Arcane Missiles!", 2)
					then
					ccrCast("Alter Time")
					return
			else
				if ccrPlayerHasBuff("Alter Time") and not ccrPlayerHasDebuff("Arcane Charge") and not ccrPlayerHasBuff("Arcane Missiles!")
					then
					ccrCast("Alter Time")
					return
				end
			end
			
		-- Rune Of Power
			if not ccrPlayerHasBuff("Rune of Power")
				and not ccrPlayerIsMoving()
				and (vLastHoG == nil or (GetTime() - vLastHoG > 5))
					then
					ccrCast("Rune of Power")
					vLastHoG = GetTime()
					if SpellIsTargeting() == 1 then CastAtLocation(Player:GetLocation()) end
					return
			end
		-- AOE
			if ccR_HostilesNearPlayer(10) > 6
				then
				ccrCast("Arcane Explosion")
				return
			else
		-- Multidotting	
			if #tblPGetNearbyEnemies > 1
			and ccR_Mage_CheckForMissingBomb() then
			ccR_Mage_ApplyMissingBomb() return end end
	
			if ccrPlayerHasBuff("Profound Magic")
				and ccrPlayerHasDebuff("Arcane Charge")
				and ccrPlayerHasDebuffStacks("Arcane Charge", 3) 
				and ccrPlayerMana() > 93
					then
					ccrCastAttack("Arcane Blast")
					return
			else 
				if ccrPlayerHasDebuff("Arcane Charge") and ccrPlayerHasDebuffStacks("Arcane Charge", 4) and ccrPlayerHasBuff("Arcane Missiles!")
					then 
					ccrCastAttack("Arcane Missiles")
					return
				else
					if not (ccrTargetHasMyDebuff("Living Bomb") or ccrTargetHasMyDebuff("Nether Tempest") or ccrTargetHasMyDebuff("Frost Bomb"))
						then
						ccrCastAttack("Mage Bomb")
						return
					else
						if ccrPlayerHasDebuff("Arcane Charge") and ccrPlayerHasDebuffStacks("Arcane Charge", 4)
							and ccrPlayerMana() < 95
							then 
							ccrCastAttack("Arcane Barrage")
							return
						else
							if SpellIsReady("Presence of Mind")
								then
								ccrCast("Presence of Mind")
								return
							else
								if SpellIsReady("Arcane Blast")
									then
									ccrCastAttack("Arcane Blast")
									return
								else
									if ccrPlayerIsMoving()
										then
										ccrCastAttack("Arcane Barrage")
										return
									else
										if ccrPlayerIsMoving()
											then
											ccrCastAttack("Fire Blast")
											return
										else
											if ccrPlayerIsMoving()
												then
												ccrCastAttack("Ice Lance")
												return
											end
										end
									end
								end
							end
						end
					end
				end
			end
			
			
						
	end
end			